package com.zf.lease.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zf.lease.mapper.CustomerContractMapper;
import com.zf.lease.domain.CustomerContract;
import com.zf.lease.service.ICustomerContractService;

/**
 * 用户和契约的关系Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-07
 */
@Service
public class CustomerContractServiceImpl extends ServiceImpl<CustomerContractMapper, CustomerContract> implements ICustomerContractService {
    @Autowired
    private CustomerContractMapper customerContractMapper;

    /**
     * 查询用户和契约的关系
     *
     * @param contractId 用户和契约的关系主键
     * @return 用户和契约的关系
     */
    @Override
    public CustomerContract selectCustomerContractByContractId(Long contractId) {
        return customerContractMapper.selectCustomerContractByContractId(contractId);
    }

    /**
     * 查询用户和契约的关系列表
     *
     * @param customerContract 用户和契约的关系
     * @return 用户和契约的关系
     */
    @Override
    public List<CustomerContract> selectCustomerContractList(CustomerContract customerContract) {
        return customerContractMapper.selectCustomerContractList(customerContract);
    }

    /**
     * 新增用户和契约的关系
     *
     * @param customerContract 用户和契约的关系
     * @return 结果
     */
    @Override
    public int insertCustomerContract(CustomerContract customerContract) {
            return customerContractMapper.insertCustomerContract(customerContract);
    }

    /**
     * 修改用户和契约的关系
     *
     * @param customerContract 用户和契约的关系
     * @return 结果
     */
    @Override
    public int updateCustomerContract(CustomerContract customerContract) {
        return customerContractMapper.updateCustomerContract(customerContract);
    }

    /**
     * 批量删除用户和契约的关系
     *
     * @param contractIds 需要删除的用户和契约的关系主键
     * @return 结果
     */
    @Override
    public int deleteCustomerContractByContractIds(Long[] contractIds) {
        return customerContractMapper.deleteCustomerContractByContractIds(contractIds);
    }

    /**
     * 删除用户和契约的关系信息
     *
     * @param contractId 用户和契约的关系主键
     * @return 结果
     */
    @Override
    public int deleteCustomerContractByContractId(Long contractId) {
        return customerContractMapper.deleteCustomerContractByContractId(contractId);
    }
}